<template>
  <yd-layout>
    <!-- 顶部导航 -->
    <yd-navbar slot="navbar" :title="title" height=".88rem" bgcolor="#fff" color="#444" fontsize=".3rem">
      <yd-navbar-back-icon slot="left" color="#666" @click.native="$router.back()"></yd-navbar-back-icon>
    </yd-navbar>

    <w-empty v-if="!content"></w-empty>

    <!-- 内容 -->
    <div class="m-detail-text" v-html="content"></div>
  </yd-layout>
</template>

<script>
  import { apiHeadLineContent } from 'js/api'

  export default {
    data() {
      return {
        title: '',
        content: ''
      }
    },
    created() {
      const id = this.$route.params.id || 0
      this.title = decodeURIComponent(this.$route.query.title || '')
      apiHeadLineContent(Number(id)).then(data => {
        this.content = data.topInfo || ''
      })
    }
  }
</script>

<style lang="scss">
</style>